<template>
  <my-modal v-model:visible="props.ckdUvisible" @update:visible="handelClose" :title="props.title">
    <a-table
      :pagination="false"
      :columns="zgtColumn"
      :data-source="subtitleList"
      :border="true"
      style="width: 100%"
      :scroll="{ x: 100 }"
    >
    </a-table>
  </my-modal>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const zgtColumn = ref([
  {
    title: '题目编号',
    dataIndex: 'tmbh',
    key: 'tmbh',
    align: 'center',
    width: 60,
  },
  {
    title: '参考答案',
    dataIndex: 'ckda',
    key: 'ckda',
    align: 'center',
    width: 60,
    customRender: ({ value }) => {
      return typeof value == 'boolean' ? (value ? '√' : '×') : value
    },
  },
  {
    title: '评阅答案',
    dataIndex: 'pyDa',
    key: 'pyDa',
    align: 'center',
    width: 60,
    customRender: ({ value }) => {
      return typeof value == 'boolean' ? (value ? '√' : '×') : value === 'Z' ? '未作答' : value
    },
  },
  {
    title: '得分',
    dataIndex: 'pyZdf',
    key: 'pyZdf',
    align: 'center',
    width: 60,
  },
])

import myModal from '/@/views/teacher/review/modal.vue'

const props = defineProps({
  title: {
    type: String,
    dafault: '评阅明细',
  },
  ckdUvisible: {
    type: Boolean,
    default: false,
  },
  subtitleList: {
    type: Array,
    default: () => [],
  },
})

const emits = defineEmits(['update:ckdUvisible'])

function handelClose() {
  emits('update:ckdUvisible', false)
}
</script>
